#include "stdafx.h"
#include "NtD3DLight9.h"

NtD3DLight9::NtD3DLight9()
{
	ZeroMemory(this, sizeof(NtD3DLight9));
}

NtD3DLight9::~NtD3DLight9(void)
{
}

void NtD3DLight9::SetDirectionLight( D3DXVECTOR3* direction, D3DXCOLOR* color )
{
	Type		= D3DLIGHT_DIRECTIONAL;
	Ambient		= *color * 0.6f;
	Diffuse		= *color;
	Specular	= *color * 0.6f;
	Direction	= *direction;
}

void NtD3DLight9::SetPointLight( D3DXVECTOR3* position, D3DXCOLOR* color )
{
	Type		= D3DLIGHT_POINT;
	Ambient		= *color * 0.6f;
	Diffuse		= *color;
	Specular	= *color * 0.6f;
	Position	= *position;
	Range		= 1000.0f;
	Falloff		= 1.0f;
	Attenuation0= 1.0f;
	Attenuation1= 0.0f;
	Attenuation2= 0.0f;
}

void NtD3DLight9::SetSpotLight( D3DXVECTOR3* position, D3DXVECTOR3* direction, D3DXCOLOR* color )
{
	Type		= D3DLIGHT_SPOT;
	Ambient		= *color * 0.0f;
	Diffuse		= *color;
	Specular	= *color * 0.6f;
	Position	= *position;
	Direction	= *direction;
	Range		= 1000.0f;
	Falloff		= 1.0f;
	Attenuation0= 1.0f;
	Attenuation1= 0.0f;
	Attenuation2= 0.0f;
	Theta		= 0.4f;
	Phi			= 0.9f;
}
